<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/templates/lista.xhtml">
    <ui:param name="pPageTitle" value="${label['ficha.titulo']}"/>
    <ui:param name="pAction" value="cadastrarFicha"/>
    <ui:param name="pManagedBean" value="#{fichaView}"/>
    <ui:param name="pTarget" value="#{fichaView.ficha}"/>
    <ui:param name="pListaRecords" value="#{fichaView.fichas}"/>
    <ui:param name="pMsgConfirmationObject" value="ficha"/>
    <ui:param name="pMsgConfirmationDescription" value="#{fichaView.ficha.nome}"/>
    <ui:define name="dataTable">
        <p:column sortBy="#{obj.nome}" filterBy="#{obj.nome}" filterMatchMode="contains">
            <f:facet name="header">
                <h:outputText value="${label['ficha.nome']}"/>
            </f:facet>
            <h:outputText value="#{obj.nome}"/>
        </p:column>
        <p:column sortBy="#{obj.cpf}" headerText="${label['ficha.cpf']}" filterBy="#{obj.cpf}" filterMatchMode="contains">
            <h:outputText value="#{obj.cpf}"/>
        </p:column>
        <p:column sortBy="#{obj.cns}" filterBy="#{obj.cns}" filterMatchMode="contains">
            <f:facet name="header">
                <h:outputText value="${label['ficha.cns']}"/>
            </f:facet>
            <h:outputText value="#{obj.cns}"/>
        </p:column>
        <p:column sortBy="#{obj.unidade.nomUnid}" filterBy="#{obj.unidade.nomUnid}" filterMatchMode="contains">
            <f:facet name="header">
                <h:outputText value="${label['ficha.unidade']}"/>
            </f:facet>
            <h:outputText value="#{obj.unidade.nomUnid}"/>
        </p:column>
        <p:column sortBy="#{obj.motivo.descricao}" filterBy="#{obj.motivo.descricao}" filterMatchMode="contains">
            <f:facet name="header">
                <h:outputText value="${label['ficha.motivo']}"/>
            </f:facet>
            <h:outputText value="#{obj.motivo.descricao}"/>
        </p:column>
        <p:column filterBy="#{obj.status}" filterOptions="#{fichaView.filterOptions}" filterMatchMode="exact">
            <h:outputText value="#{obj.status}"/>
        </p:column>
        <p:column sortBy="#{obj.obs}" headerText="${label['ficha.obs']}" filterBy="#{obj.obs}" filterMatchMode="contains">
            <f:facet name="header">
                <h:outputText value="${label['ficha.obs']}"/>
            </f:facet>
            <h:outputText value="#{obj.obs}"/>
        </p:column>
    </ui:define>
</ui:composition>